
var JieCell = function(aoParentRow){

	JieElement.call(this);//继承JieElement类的属性
	this.element = this.makeElement(Properties.system.CELL_TAG);
	//this.element.style.overflow = "hidden";
	this.element.dataObj = this;
	
	if (aoParentRow != null) {
		this.oParentRow = aoParentRow;
		this.setHeight(aoParentRow.getHeight());
	}else{
		this.oParentRow = aoParentRow;
		this.setHeight(0);
	}

	this.isFixed = false;
	this.isEdit = false;
	
	this.setWidth(Properties.grid.cell.width);	
	this.value = "";

	this.setValue = function(asValue){
		this.value = asValue;
		Util.removeChild(this.element);
		this.element.appendChild(document.createTextNode(this.value));

	}
//	this.element.className = "JieCell";
};

JieCell.prototype = JieElement.prototype;//继承JieElement类的共有方法

/**
 * 向父父节点添加一个单元格，系统将调用父节点的【asMethodName】指定的方法获取父节点的页面元素(element)并将自己的元素添加至其上
 * @param {string} asMethodName[必填] 表示用于获取父节点页面元素的方法名，该方法没有任何参数
 * @param {Object} aoParentRow[选填] 当该参数为空时，系统将调用构造是传入的默认父节点，当默认父节点也为空时，系统将抛出异常
 */
JieCell.prototype.appendCell = function(asMethodName, aoParentRow){

	if (aoParentRow == null) {
		if (this.oParentRow == null) 
			throw new Error(sGmsg["CELL_001"]);
	}
	else {
		this.oParentRow = aoParentRow;
		this.setHeight(aoParentRow.getHeight());
	}
	//this.oParentRow.appendChild(this.element);
	if(asMethodName == null || typeof(asMethodName) != "string") throw new Error(sGmsg["CELL_002"]);
	if(typeof(this.oParentRow[asMethodName]) != "function") throw new Error(MsgManager.getMessage("CELL_003", new Array(asMethodName)));
	
	var elParent = this.oParentRow[asMethodName].call(this.oParentRow, asMethodName);
	this.setHeight(this.oParentRow.getHeight());
//	alert(elParent.tagName);
	elParent.appendChild(this.element);
	
}
JieCell.prototype.getListners = function(asEventType){
	
}
JieCell.prototype.setValue = function(asValue){
	this.setValue(asValue);
	//this.element.innerHTML = asValue;
}
JieCell.prototype.getValue = function(){
	return this.value;
}
